﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;

namespace SWIReader
{
    class SWIReader
    {
        static void Main(string[] args)
        {
            Process compiler = new Process();
            compiler.StartInfo.FileName = @"C:\Program FIles\pl\bin\swipl.exe";
            compiler.StartInfo.Arguments = @"-f " + args[0] + " -g " + args[1] + ",halt";
            compiler.StartInfo.UseShellExecute = false;
            compiler.StartInfo.CreateNoWindow = true;
            compiler.StartInfo.RedirectStandardOutput = true;
            compiler.StartInfo.RedirectStandardInput = true;
            compiler.Start();

            string swiOut = compiler.StandardOutput.ReadToEnd();

            Console.WriteLine(swiOut);
        }
    }
}
